program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, a, sum, i: integer;

begin
  read (n);
  sum:= 0;
  for i := 0 to n - 1 do
  begin
    read (a);
    if ((i mod 2 = 0) and (a<>1)) or ((i mod 2 = 1) and (a<>2))then
      inc (sum);
  end;
  write (sum);
end.
